package com.newcapec.modules.iot.utils;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

/**
 * 向物联网响应格式类
 */
public class IotResponse implements Serializable{

	private static final long serialVersionUID = 1L;

	private String method;
	
	/**
	 * 参数JSON
	 * 新增注解,属性支持序列化
	 */
	@JsonProperty
	private Object param;
	
	private int retcode = 200;
	
	private String retmsg = "ok";
	
	private String signType = "";
	
	private String encrypt = "";
	
	public IotResponse(){
	}
	
	public IotResponse(String method, Object param, int retcode, String retmsg, String signType, String encrypt){
		this.method = method;
		this.param = param;
		this.retcode=retcode;
		this.retmsg=retmsg;
		this.signType=signType;
		this.encrypt = encrypt;
	}
	
	public IotResponse(Object param){
		this.param = param;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public Object getParam() {
		return param;
	}

	public void setParam(Object param) {
		this.param = param;
	}

	public int getRetcode() {
		return retcode;
	}

	public void setRetcode(int retcode) {
		this.retcode = retcode;
	}

	public String getRetmsg() {
		return retmsg;
	}

	public void setRetmsg(String retmsg) {
		this.retmsg = retmsg;
	}

	public String getSignType() {
		return signType;
	}

	public void setSignType(String signType) {
		this.signType = signType;
	}

	public String getEncrypt() {
		return encrypt;
	}

	public void setEncrypt(String encrypt) {
		this.encrypt = encrypt;
	}

	@Override
	public String toString() {
		String paramStr = param == null ? "null content" : param.toString();
		return "JsonData [method=" + method + ", param=" + paramStr + ", retcode="
				+ retcode + ", retmsg=" + retmsg + ", signType=" + signType
				+ ", encrypt=" + encrypt + "]";
	}
	
}